package org.six11.ss.server;

import java.io.IOException;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.six11.ss.server.bean.Sketch;
import org.six11.util.adt.MultiState;

/**
 * 
 * 
 * @author Gabe Johnson <johnsogg@cmu.edu>
 */
public class IndexWebActionHandler extends WebActionHandler {

  public IndexWebActionHandler(String name, String jspName, MultiState ms) {
    super(name, jspName, ms);
  }

  public void handle(HttpServletRequest req, HttpServletResponse resp, ServletContext context)
      throws ServletException, IOException {
    BrowseWebActionHandler bw = getBrowseHandler();
    req.setAttribute("sketches", bw.getRecentSketches());
    String sessionID = req.getSession().getId();
    String msg = "your session string is " + sessionID;
    bug("setting msg to: " + msg);
    req.setAttribute("msg", msg);
    forwardTo(jsp, req, resp, context);
  }
  

}
